<template>
    <div>
        搜索
        <van-field label="标题" placeholder="请输入标题" v-model="title"/>
        <button @click="sou">搜索</button>
        <!-- <p>
            <ul>
                <li v-for="i in searchlist"></li>
            </ul>
        </p> -->
        <br>
        展示
        <table>
            <tr>
                <td>标题</td>
                <td>内容</td>
            </tr>
            <tr v-for="i in list">
                <td>{{i.title}}</td>
                <td>{{i.content}}</td>
            </tr>
        </table>
    </div>
</template>
content
<script>
    export default {
        data(){
            return{
                title:'',
                list:[],
                searchlist:[]
            }
        },
        methods:{
            sou(){
                this.$axios.get('search?title='+this.title)
                .then(res=>{
                    this.list=res.data.list
                })
            },
            
        },
        mounted(){

        }
    }
</script>

<style scoped>

</style>